import * as toast from './util/toast/toast'
import * as api from './api/index'
import bridge  from './util/tool/spbridge'
import * as router  from './util/router/router'
import util from '@/util/tool/util'
import User from './store/user'
import * as UserUtil from './store/userutil'
import moment from 'moment/moment'

import  customnavi from '@/components/custom/customnavi.vue'

///微信js
//#ifdef H5
import wx from 'weixin-js-sdk'
//#endif


export default {
    install(Vue){
        //用户信息
        Vue.prototype.$User = User;
        Vue.prototype.$userutil = UserUtil;
        //toast工具类
        Vue.prototype.$toast = toast;
        //网络请求工具类
        Vue.prototype.$api = api;
        //js交互工具类
        Vue.prototype.$bridge = bridge;
        //路由工具类
        Vue.prototype.$approuter = router;
        //通用工具类
        Vue.prototype.$util = util;
        //日期转换工具类
        Vue.prototype.$moment = moment;
        
        // #ifdef H5
         //微信js
         Vue.prototype.$wxJS = wx
          //调试工具
        require('./util/tool/vconsole')
        // #endif
       

        ///自定义导航栏
       Vue.component('customnavi',customnavi)
        //时间格式化工具
        Vue.filter('dateFormat', (value, pattern = 'yyyy-MM-dd HH:mm:ss') => {
            return moment(value).format(parent)
        })
        
    
    }
}